import * as echarts from 'echarts'
const echartsUtil = {}

/**
 * 获取渐变色
 */
echartsUtil.getLinearGradient = function (left, top, right, bottom, primary, normal) {
    return {
        normal: {
            color: new echarts.graphic.LinearGradient(left, top, right, bottom, [{
                offset: 0,
                color: normal
            }, {
                offset: 1,
                color: primary
            }])
        }
    }
}

echartsUtil.initMyChart = function (myChart) {
    return echarts.init(myChart);
}

export default echartsUtil